<{include file="_head.html"}>
<link type="text/css" rel="stylesheet" href="css/default.css" />
<script language="javascript" type="text/javascript" src="My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">
$(function(){
	$("[name=continent]").click(function(){
		var continent_id = $(this).val();
		var continent=$(this).find("option:selected").html();
		var url='ajax.php?action=getCountry';
		$.post(
			url,
			{continent_id:continent_id},
			function(data){
				if(data!=''){
					$("[name=country]").html(data);
					$('input:[name="continentValue"]').val(continent);
				}
			}
			)
	})

	$("[name=country]").click(function(){
		var country=$(this).find("option:selected").html();
		$('input:[name="countryValue"]').val(country);
	})

	//提交表单
	$(".j_jhwj2").click(function(){
		$("#myForm").submit();
	})

	//删除
	$(".del").live("click",function(){
		var yes=confirm("确定要进行删除操作？");
		var obj=$(this);
		var id=obj.attr("id");
		var label=obj.attr("label");
		var url='user_basic_info.php?action=del';
		if(yes){
			$.post(
				url,
				{label:label,id:id},
				function(data){
					if(data==1){
						obj.parent().parent().remove();
					}
				}
				)
		}else{
			return false;
		}
	})

	//添加海外经历
	$(".j_jhwjl").click(function(){
		var yes = queding("确认新增海外经历?",".subCheck");
		var continent_id=$("[name=continent]").val();
		var country_id=$("[name=country]").val();
		var over_school=$("[name=over_school]").val();
		var over_profession=$("[name=over_profession]").val();
		var city=$("[name=city]").val();
		var entrance_time=$("[name=entrance_time]").val();
		var granduate_time=$("[name=granduate_time]").val();
		var continent=$('input:[name="continentValue"]').val();
		var country=$('input:[name="countryValue"]').val();
		if(yes){
			$.post(
				'user_basic_info.php?action=addExper&type=oversea',
				{continent_id:continent_id,country_id:country_id,over_school:over_school,
					over_profession:over_profession,city:city,entrance_time:entrance_time,
					granduate_time:granduate_time,continent:continent,country:country},
				function(data){
					if(data.error>0){
						$(".oversea").last().after(data.html);
					}
				},'json'
				)
		}
	})

    //添加工作/教育经历
    $(".j_bjzlnxny3").click(function(){
        var label=$(this).attr("label");
        var subCheck='subCheckw';
        if(label=='work'){
            var experience=$("[name=experience]").val();
            var position=$("[name=position]").val();
            var limit=$("[name=limit]").val();
        }else{
            var school=$("[name=school]").val();
            var profession=$("[name=profession]").val();
            subCheck='subChecke'; 
        }
        var ques=label=='work'?'工作经历':'教育经历';
        var yes = queding("确认新增"+ques+"?","."+subCheck);
       
        if(yes){
            $.post(
                'user_basic_info.php?action=addExper&type='+label,
                {experience:experience,position:position,limit:limit,
                   school:school,profession:profession},
                function(data){
                    if(data.error>0){
                        $("."+label).last().after(data.html);
                    }
                },'json'
                )
        }
    })
})
</script>

<{include file="head.html"}>

<!-- 主体内容-开始 -->
<div class="j_bjzl">
	<div class="j_bjzln">
    	<div class="j_bjzlns">
        	<span class="j_bjzlns1">资料完善度</span>
            <span class="j_bjzlns2"><span style="width:<{$percent}>%"><{$percent}>%</span></span>
        </div>
        <form method="post" action="user_basic_info.php" id="myForm" enctype='multipart/form-data'>
        <div class="j_bjzlnx">
        	<span class="j_bjzlnxt">编辑个人资料</span>
            <div class="j_bjzlnxn">
            	<span class="j_bjzlnxnz">自我介绍</span>
                <div class="j_bjzlnxny">
                	<textarea name="self_intro" cols="" rows="" class="j_bjzlnxny1"><{$info.self_intro}></textarea>
                </div>
            </div>
            <div class="j_bjzlnxn">
            	<span class="j_bjzlnxnz">居 住 地</span>
                <div class="j_bjzlnxny">
                	<input type="text" name="address" value="<{$info.address}>" class="j_bjzlnxny2" />
                	<!-- <input type="button" value="添 加" class="j_bjzlnxny3" /> -->
                    
                </div>
            </div>
            <div class="j_bjzlnxn">
            	<span class="j_bjzlnxnz">教育经历</span>
                <div class="j_bjzlnxny">
                	<input type="text" value="" name="school" placeholder="学校或教育机构名" class="j_xxjg1 subChecke" />
                    <input type="text" value="" name="profession" placeholder="专业选填" class="j_xxjg1 subChecke" />
                	<input type="button" value="添 加" label="educate" class="j_bjzlnxny3" style="margin-left:0;" />
                     <span class="j_bjzlnxny4 educate" style="display:none;">
                        <span class="j_bjzlnxny41"></span>
                    </span>
                	<{foreach item=res from=$educateList}>
                	<span class="j_bjzlnxny4 educate">
                    	<span class="j_bjzlnxny41">学校：<{$res.school}>&nbsp;专业：<{$res.profession}><a href="javascript:;" class="del" label="educate" id="<{$res.id}>">×</a></span>
                    </span>
                    <{/foreach}>
                </div>
            </div>
            <div class="j_bjzlnxn">
            	<span class="j_bjzlnxnz">工作经历</span>
                <div class="j_bjzlnxny">
                	<input type="text" value="" name="experience" placeholder="学校或教育机构名" class="j_xxjg1 subCheckw" />
                    <!-- <select class="j_xxjg2">
                    	<option>职位</option>
                    	<option>职位</option>
                    	<option>职位</option>
                    	<option>职位</option>
                    </select> -->
                    <input type="text" value="" name="position" class="j_xxjg2 subCheckw" placeholder="职位"/>
                    <input type="text" value="" name="limit" placeholder="年限" class="j_xxjg2 subCheckw" />
                	<input type="button" value="添 加" label="work" class="j_bjzlnxny3" style="margin-left:0;" />
                    <span class="j_bjzlnxny4 work" style="display:none;">
                        <span class="j_bjzlnxny41"></span>
                    </span>
                	<{foreach item=res from=$workList}>
                	<span class="j_bjzlnxny4 work">
                    	<span class="j_bjzlnxny41">工作（公司）：<{$res.experience}>&nbsp;职位：<{$res.position}>&nbsp;年限：<{$res.limit}><a label="work" class="del" id="<{$res.id}>" href="javascript:;">×</a></span>
                    </span>
                    <{/foreach}>
                </div>
            </div>
            <div class="j_bjzlnxn">
            	<span class="j_bjzlnxnz">海外经历</span>
                <div class="j_bjzlnxny">
                	<span class="j_hwjl">如有海外经历请填写，无请略过</span>
                    <div class="j_hwjly">
                    	<div class="inshow" >
                    	<div class="j_hwjlyn">
                    		<span class="j_hwjlynz">洲&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;际</span>
                        	<div class="j_hwjlyny">
                                <select class="j_bjzlnxny2 subCheck" checkMsg="请选择洲际！" name="continent">
                                    <option value="">洲际</option>
                                    <{foreach item=res from=$continents}>
                                    <option value="<{$res.id}>"><{$res.continent}></option>
                                    <{/foreach}>
                                </select>
                                <input type="hidden" name="continentValue" value="">
                    		</div>
                        </div>
                    	<div class="j_hwjlyn">
                    		<span class="j_hwjlynz">国&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;家</span>
                        	<div class="j_hwjlyny">
                                <select class="j_bjzlnxny2 subCheck" checkMsg="请选择国家！" name="country">
                                    <option value="">国家</option>
                                </select>
                                <input type="hidden" name="countryValue" value="">
                    		</div>
                        </div>
                    	<div class="j_hwjlyn">
                    		<span class="j_hwjlynz">学校名称</span>
                        	<div class="j_hwjlyny">
                                <!-- <select class="j_bjzlnxny2">
                                    <option>XXX大学</option>
                                    <option>XXX大学</option>
                                    <option>XXX大学</option>
                                </select> -->
                                <input type="text" name="over_school" value="" class="j_xxjg1 subCheck" placeholder="学校名称"/>
                    		</div>
                        </div>
                    	<div class="j_hwjlyn">
                    		<span class="j_hwjlynz">专&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;业</span>
                        	<div class="j_hwjlyny">
                                <!-- <select class="j_bjzlnxny2">
                                    <option>专业</option>
                                    <option>专业</option>
                                    <option>专业</option>
                                </select>
                                 -->
                                <input type="text" value="" name="over_profession" class="j_xxjg1 subCheck" placeholder="专业"/>
                    		</div>
                        </div>
                    	<div class="j_hwjlyn">
                    		<span class="j_hwjlynz">时&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;间</span>
                        	<div class="j_hwjlyny">
                                <!-- <select class="j_hwjlynysj">
                                    <option>2014-05-23</option>
                                    <option>2014-05-23</option>
                                    <option>2014-05-23</option>
                                </select> -->
                                <input name="entrance_time" class="j_hwjlynysj subCheck" placeholder="入学时间" value="" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd '})">
                                <!-- <select class="j_hwjlynysj">
                                    <option>2014-05-23</option>
                                    <option>2014-05-23</option>
                                    <option>2014-05-23</option>
                                </select> -->
                                <input name="granduate_time" class="j_hwjlynysj subCheck" placeholder="毕业时间" value="" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd '})">
                    		</div>
                        </div>
                    	<div class="j_hwjlyn">
                    		<span class="j_hwjlynz">所在城市</span>
                        	<div class="j_hwjlyny">
                               <!--  <select class="j_bjzlnxny2">
                                    <option>纽约</option>
                                    <option>纽约</option>
                                    <option>纽约</option>
                                </select> --> 
                                <input type="text" value="" name="city" class="j_xxjg1 subCheck" placeholder="所在城市"/>
                    		</div>
                        </div>
                       </div>
                    	<div class="j_hwjlyn">
                        	<a href="javascript:;" class="j_jhwjl"><span>+</span>海外经历</a>
                        </div>
                         <span class="j_bjzlnxny4 oversea" style="display:none;">
                            <span class="j_bjzlnxny41"></span>
                        </span>
                         <{foreach item=res from=$overseaList}>
	                	<span class="j_bjzlnxny4 oversea">
	                    	<span class="j_bjzlnxny41">洲际：<{$res.continent}>&nbsp;国家：<{$res.country}>&nbsp;城市：<{$res.city}>&nbsp;学校：<{$res.school}>&nbsp;专业：<{$res.profession}>&nbsp;时间：<{$res.entranceTime}>~<{$res.granduateTime}><a label="oversea" id="<{$res.id}>" class="del" href="javascript:;">×</a></span>
	                    </span>
	                    <{/foreach}>
                    	<div class="j_hwjlyn">
                        	<a href="javascript:;" class="j_jhwj2"><!-- <input type="submit" name="submit" value="保存"> -->保存</a>
                        	<input type="hidden" name="save" value="save">
                        </div>
                    </div>
                </div>
            </div>
        </div>
        </form>
    </div>
    
</div>
<!-- 主体内容-结束 -->

<{include file="footer.html"}>